import 'package:gold/base/config.dart';

/// @description: 订单相关接口
/// @author tangzhentao
/// @created at 00:19 2025/2/16

class ApiOrder {
  /// 优惠券 POST
  ///
  /// body: {
  ///
  /// page [int] 页码
  ///
  /// min_amount [String] 最低金额
  ///
  /// }
  static const couponList = 'coupon/list';

  /// 创建订单 POST
  ///
  /// body: [OrderRequest]的toJson()返回值
  static const create = 'order/create';

  /// 订单列表 POST
  ///
  /// body: {
  ///
  /// page [int] 页码
  ///
  /// status [String] 订单状态：-1=已取消,0=待支付,1=待发货,2=待收货（待提货）,3=待评价,4=已完成,5=已授权
  ///
  /// type [String] product=商品订单,gold=黄金投资订单,points=积分商品订单
  ///
  /// }
  static const list = 'order/list';

  /// 订单详情 POST
  ///
  /// body: {
  ///
  /// id [int] 订单ID
  ///
  /// }
  static const detail = 'order/detail';

  /// 删除订单 POST
  ///
  /// body: {
  ///
  /// id [int] 订单ID
  ///
  /// }
  static const delete = 'order/delete';

  /// 确认收货 POST
  ///
  /// body: {
  ///
  /// id [int] 订单ID
  ///
  /// }
  static const confirm = 'order/confirm';

  /// 申请售后 POST
  ///
  /// body: {
  ///
  /// order_id [int] 订单ID
  ///
  /// price [double] 退款价格
  ///
  /// type [int] 退款类型:0=我要退款(无需退货),1=退货退款
  ///
  /// reason [int] 退货理由:0=拍错/多拍/不喜欢,1=与商家协商一致退款,2=克数不对,3=未按约定时间发货,4=快递/物流一直未送到,5=快递/物流无跟踪记录,6=货物破损已拒签
  ///
  /// refund_content [int] 描述
  ///
  /// images [String] 多图片,用英文逗号拼接
  ///
  /// }
  static const refundCreate = 'refund/create';

  /// 售后详情 POST
  ///
  /// body: {
  ///
  /// order_id [int] 订单ID
  ///
  /// }
  static const refundDetail = 'refund/detail';

  /// 授权待取 POST
  ///
  /// body: {
  ///
  /// order_id [int] 订单ID
  ///
  /// pickup_user_id [int] 提货用户ID
  ///
  /// }
  static const setPickupUser = 'order/setPickupUser';

  /// 取消订单 POST
  ///
  /// body: {
  ///
  /// id [int] 订单id
  ///
  /// reason [int] 取消订单理由：0=价格有点贵，1=规格/款式/数量拍错，2=收获地址填错，3=商家不支持花呗，4=暂时不需要了，5=其他，6=超时自动取消(取消订单时前端不展示这个选项)
  ///
  /// }
  static const cancel = 'order/cancel';

  /// 订单支付 POST
  ///
  /// body: {
  ///
  /// id [int] 订单ID
  ///
  /// }
  static const wechatPay = 'pay/wechatPay';

  /// 直接设置支付成功（测试用） POST
  ///
  /// body: {
  ///
  /// id [int] 订单ID
  ///
  /// }
  static const testPay = 'pay/directPay';

  /// 发布评论 POST
  ///
  /// body: {
  ///
  /// order_id   [int] 订单ID
  ///
  /// product_id [int] 商品ID
  ///
  /// rating [int] 评分 ：1-5数字
  ///
  /// comment [int] 评论文字
  ///
  /// is_private [int] 是否匿名：0=不匿名，1=匿名
  ///
  /// images [int] 图片列表，用英文逗号拼接
  ///
  /// }
  static const review = 'reviews/add';
}
